# !ResCreate Makefile

# ****** EDIT MAKEPROTO, NOT MAKEFILE ******
# Then construct Makefile using "amu -f MakeProto depend"

# PROGDIR should be set to the application's install directory

# Can set:
#  CFLAGS     -  additional cc options
#  LDFLAGS    -  additional link options

INCLUDES = -IC:

CPFLAGS = A~C~DF~L~N~P~Q~R~S~T~V

LIBS = C:o.toolboxlib C:o.eventlib C:o.Stubs

CFILES = alloc.c debug.c error.c main.c message.c

OFILES = alloc.o debug.o error.o main.o message.o

FILES = !Help !Run !RunImage !Sprites !Sprites22 Messages Res

all: !RunImage
        @echo *** ResCreate build complete

!RunImage: $(OFILES)
        link $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
        squeeze $@

.c.o:
        cc -c $(CFLAGS) $(INCLUDES) -o $@ $<

install: $(FILES)
        copy !Help $(PROGDIR).!Help $(CPFLAGS)
        copy !Run $(PROGDIR).!Run $(CPFLAGS)
        copy !RunImage $(PROGDIR).!RunImage $(CPFLAGS)
        copy !Sprites $(PROGDIR).!Sprites $(CPFLAGS)
        copy !Sprites22 $(PROGDIR).!Sprites22 $(CPFLAGS)
        copy Messages $(PROGDIR).Messages $(CPFLAGS)
        copy Res $(PROGDIR).Res $(CPFLAGS)
        @echo *** ResCreate installation complete

depend:
        copy MakeProto Makefile1 $(CPFLAGS)
        cc -c -M $(INCLUDES) $(CFILES) >> Makefile1
        remove Makefile0
        -rename Makefile Makefile0
        rename Makefile1 Makefile
        @echo *** ResCreate dependencies established

clean:
       create o.foo
       wipe o.* ~CRF~V
       remove !RunImage
       @echo *** ResCreate cleaned

# Dependencies following this line provided by make depend

o.alloc:	c.alloc
o.alloc:	h.main
o.alloc:	C:h.swis
o.alloc:	C:h.kernel
o.alloc:	C:h.kernel
o.alloc:	C:h.event
o.alloc:	C:h.wimp
o.alloc:	C:h.toolbox
o.alloc:	C:h.toolbox
o.alloc:	C:h.window
o.alloc:	C:h.gadgets
o.alloc:	C:h.gadgets
o.alloc:	C:h.menu
o.alloc:	C:h.saveas
o.alloc:	C:h.wimplib
o.alloc:	h.message
o.alloc:	h.error
o.alloc:	h.debug
o.alloc:	h.alloc
o.debug:	c.debug
o.debug:	h.main
o.debug:	C:h.swis
o.debug:	C:h.kernel
o.debug:	C:h.kernel
o.debug:	C:h.event
o.debug:	C:h.wimp
o.debug:	C:h.toolbox
o.debug:	C:h.toolbox
o.debug:	C:h.window
o.debug:	C:h.gadgets
o.debug:	C:h.gadgets
o.debug:	C:h.menu
o.debug:	C:h.saveas
o.debug:	C:h.wimplib
o.debug:	h.message
o.debug:	h.error
o.debug:	h.debug
o.error:	c.error
o.error:	h.main
o.error:	C:h.swis
o.error:	C:h.kernel
o.error:	C:h.kernel
o.error:	C:h.event
o.error:	C:h.wimp
o.error:	C:h.toolbox
o.error:	C:h.toolbox
o.error:	C:h.window
o.error:	C:h.gadgets
o.error:	C:h.gadgets
o.error:	C:h.menu
o.error:	C:h.saveas
o.error:	C:h.wimplib
o.error:	h.message
o.error:	h.error
o.error:	h.debug
o.main:	c.main
o.main:	h.main
o.main:	C:h.swis
o.main:	C:h.kernel
o.main:	C:h.kernel
o.main:	C:h.event
o.main:	C:h.wimp
o.main:	C:h.toolbox
o.main:	C:h.toolbox
o.main:	C:h.window
o.main:	C:h.gadgets
o.main:	C:h.gadgets
o.main:	C:h.menu
o.main:	C:h.saveas
o.main:	C:h.wimplib
o.main:	h.message
o.main:	h.error
o.main:	h.debug
o.message:	c.message
o.message:	h.main
o.message:	C:h.swis
o.message:	C:h.kernel
o.message:	C:h.kernel
o.message:	C:h.event
o.message:	C:h.wimp
o.message:	C:h.toolbox
o.message:	C:h.toolbox
o.message:	C:h.window
o.message:	C:h.gadgets
o.message:	C:h.gadgets
o.message:	C:h.menu
o.message:	C:h.saveas
o.message:	C:h.wimplib
o.message:	h.message
o.message:	h.error
o.message:	h.debug
